import {myNewTaskForStudent} from '../api/task.js'
export default async function tabBarUpdate() {
	const res = await myNewTaskForStudent()
	const testCount = res.info.Quizetask + res.info.examtask
	const writtingCount = res.info.reviewtask + res.info.writingtask
	if(testCount > 0){
		uni.setTabBarBadge({
			index: 1,
			text: testCount + ''
		})
	}else{
		uni.removeTabBarBadge({
			index: 1
		})
	}
	// if(writtingCount > 0){
	// 	uni.setTabBarBadge({
	// 		index: 2,
	// 		text: writtingCount + ''
	// 	})
	// }else{
	// 	uni.removeTabBarBadge({
	// 		index: 2
	// 	})
	// }
}